package com.sunxu.spring;

import com.sunxu.spring.service.MessageService;

/**
 * @author 孙许
 * @date 2018-07-13
 * @description 没有自动注入的化，则必须set注入或者构造器注入
 */
public class MessagePrinter {

    private MessageService service;

    public void setService(MessageService service) {
        this.service = service;
    }

    public void printMessage() {
        System.out.println(this.service.getMessage());
    }
}
